//
//  InterfaceJumpEncapsulation.m
//  XiaoXiaoJiang
//
//  Created by 小匠科技 on 16/3/28.
//  Copyright © 2016年 LSZ. All rights reserved.
//

#import "InterfaceJumpEncapsulation.h"


@implementation InterfaceJumpEncapsulation
+(void)jumpToNewTabBar :(int)numPag
{
    UITabBarController *tb=[[UITabBarController alloc]init];
    UIWindow * window = [UIApplication sharedApplication].delegate.window;
    //a.初始化一个tabBar控制器
    //设置控制器为Window的根控制器
    window.rootViewController=tb;
   //b.创建子控制器
    LSZInformationVC *c1=[[LSZInformationVC alloc]init];
    c1.tabBarItem.title=@"扶贫资讯";
    c1.tabBarItem.image=[UIImage imageNamed:@"资讯_没点"];
    UIImage * dis_select = [UIImage imageNamed:@"资讯_点击"];
    c1.tabBarItem.selectedImage = [dis_select imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    LSZLearningVC *c2=[[LSZLearningVC alloc]init];
    c2.tabBarItem.title=@"扶贫办公";
    c2.tabBarItem.image=[UIImage imageNamed:@"学习_没点"];
    UIImage * second_select = [UIImage imageNamed:@"学习_点击"];
    c2.tabBarItem.selectedImage = [second_select imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    LSZPartyViewController *c3=[[LSZPartyViewController alloc]init];
    c3.tabBarItem.title=@"扶贫培训";
    c3.tabBarItem.image=[UIImage imageNamed:@"党务_没点"];
    UIImage * third_select = [UIImage imageNamed:@"党务_点击"];
    c3.tabBarItem.selectedImage = [third_select imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    LSZHelpEachOtherVC *c4=[[LSZHelpEachOtherVC alloc]init];
    c4.tabBarItem.title=@"扶贫圈";
    c4.tabBarItem.image=[UIImage imageNamed:@"互助_没点"];
    UIImage * four_select = [UIImage imageNamed:@"互助_点击"];
    c4.tabBarItem.selectedImage = [four_select imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

    LSZMyViewController *c5=[[LSZMyViewController alloc]init];
    c5.tabBarItem.title=@"个人中心";
    c5.tabBarItem.image=[UIImage imageNamed:@"我的_没点"];
    UIImage * five_select = [UIImage imageNamed:@"我的_点击"];
    c5.tabBarItem.selectedImage = [five_select imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
 
    //c.2第二种方式
    UINavigationController* navigationVC1 =[[UINavigationController alloc]initWithRootViewController:c1];
    UINavigationController * navigationVC2 =[[UINavigationController alloc]initWithRootViewController:c2];
    UINavigationController* navigationVC3 =[[UINavigationController alloc]initWithRootViewController:c3];
    UINavigationController* navigationVC4 =[[UINavigationController alloc]initWithRootViewController:c4];
    UINavigationController* navigationVC5 =[[UINavigationController alloc]initWithRootViewController:c5];
    tb.viewControllers=@[navigationVC1,navigationVC2,navigationVC3,navigationVC4,navigationVC5];
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:themeColor ,NSForegroundColorAttributeName,[UIFont systemFontOfSize:15],NSFontAttributeName, nil] forState:UIControlStateSelected];
    //2.设置Window为主窗口并显示出来
    [window makeKeyAndVisible];
}
@end

